# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python-mr.bob
pkgname=('python2-mr.bob' 'python-mr.bob')
_pkgname=mr.bob
pkgver=1.0.1
pkgrel=2
pkgdesc='Bob renders directory structure templates.'
arch=('any')
url='https://pypi.python.org/pypi/mr.bob/'
license=('BSD')
makedepends=('python2-setuptools' 'python-setuptools')
source=("https://pypi.python.org/packages/23/fe/25d78b8e9c84ac177fc3edae0186b842d0a788f19710c250b08a23fdb528/$_pkgname-$pkgver.tar.gz")
sha512sums=('40877bc0e783720f1d84a8d4d6430b0b3cc044dfa492e782f9a9f35df783ccb6a720c7e6e27980d40582c71a3c9b163d69aa0684dce73ea0a45c924350a6bff8')

prepare() {
  cp -a "$_pkgname-$pkgver"{,-2}
}

build() {
  cd "$_pkgname-$pkgver-2"

  python2 setup.py build

  cd "$srcdir/$_pkgname-$pkgver"

  python setup.py build
}

package_python2-mr.bob() {
  depends=('python2')

  cd "$_pkgname-$pkgver-2"

  python2 setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build

  mv "$pkgdir/usr/bin/mrbob" "$pkgdir/usr/bin/mrbob2"
}

package_python-mr.bob() {
  depends=('python')

  cd "$_pkgname-$pkgver"

  python setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build
}

